Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin
What it does
It keeps a Lerd site and the servers it runs on in step over SSH, with one environment per server, such as production and staging. It pulls a server's database into the site's Lerd database after a before-sync-pull snapshot, and the folders users upload into, rewriting a WordPress or Bedrock site's address both ways and, when the user turns it on, running a scrub SQL file that empties personal data from the pulled copy. It pushes the files the user picks, and the database after the environment's name is typed back, backing the server's database up first and putting that backup back if the import fails. Every file a transfer replaces is kept as a backup on the side it was replaced on, and backups and snapshots can be listed, viewed, restored and removed.
What it adds to Lerd
The commands
lerd sync:setup,sync:pull,sync:push,sync:status,sync:diffandsync:backups, a Pull from server entry in every site's Commands menu, a Sync site tab (environments, a side by side tree of the project here and on the server, the database and the backups), and the MCP toolssync_pull,sync_statusandsync_backupswith a skill. Pushing, restoring and removing are left off MCP on purpose.What it reads, changes and sends
.envorwp-config.phpfor the database settings, folder listings withfind, a file withcatto show it, and the database dump. Locally, the site'swp-config.phpor.envonly for its database name and table prefix, and the site list from Lerd's API.lerd db:create,db:snapshot,db:import,db:shellandwp search-replace, the files it pulls, and.lerd/scrub.sqlwhen scrubbing is on. On the server, the files it pushes and, with--db, the database after a backup. Backups go to the plugin's data folder and to~/.lerd-syncon the server, both readable only by the user. Each side's config files,.lerd/,.lerd.yamland.git/are never copied.Requirements
Node,
ssh,diffand rsync 3 or newer on the machine (macOS needsbrew install rsync, and the plugin says so when it finds an older one), and a Linux server with rsync and the database's dump tool.lerd: ">=1.38"; the tab's diff and file viewer uselerd.diffandlerd.viewfrom Lerd 1.39 and fall back to plain labels before that. Noplatforms; it has only been run on Linux so far.Images
Checklist
plugin.yamldeclareslerdas a lower bound, andplatformsif it runs on only one..envonly when the README says why.plugin.yamland only tell the user something they need to know or act on.latest, and is named in the README with its source.